package com.aat.dxfy.concurrent.demo3;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;

public class TestRun {

	public static void main(String[] args) {
		BlockingQueue<Object> queue=new ArrayBlockingQueue<>(100);
		
		Producer p1=new Producer(queue);
		Producer p2=new Producer(queue);
		
		Consumer c=new Consumer(queue);
		
		Thread t1=new Thread(p1);
		
		Thread t2=new Thread(p1);
		
		Thread t3=new Thread(p2);
		
		Thread t4=new Thread(c);
		
		t1.start();
		t2.start();
		t3.start();
		t4.start();
	}

}
